How many items target currently holds - 0 for an empty queue, up to target's own declared capacity once it is full.
queue_length(target) -> int| Name | Type |
|---|---|
target | queue |
int
How many items target currently holds - 0 for an empty queue, up to target's own declared capacity (/// @capacity, always a power of two - see queue_push - or 8 if untagged) once it is full.
This is how many items are IN target right now, not its capacity - a common use is checking whether there is still room before pushing, or showing a "3 enemies queued to spawn" count.
/// @type {queue<int>}
/// @capacity 4
var turn_order = [1, 2, 3];
var waiting = queue_length(turn_order); // 3



Just the deque's size() - O(1), identical to stack_length/list_length.